﻿using LAIR.ResourceAPIs.WordNet;

namespace CBTM.Core
{
    public struct Paths
    {
        // cơ sở dữ liệu WordNet 3.1
        public const string WNDatabase = "WNDB";

        // tài nguyên chương trình
        public const string MRD_EVDict = "Resources/EVDict.xml";
        public const string MRD_EVDictG_old = "Resources/EVDict_G_old.xml";
        public const string MRD_EVDictG_new = "Resources/EVDict_G_new.xml";
        public const string CoreWN = "Resources/core-wordnet.noun";
        public const string SW_En = "Resources/stopwords.en";
        public const string SW_Vi = "Resources/stopwords.vi";
        public const string SenseIndex = "Resources/index.sense";

        // các tập tin được tạo ra trong quá trình chạy chương trình
        public const string WNIndex = "Misc/wnindex.txt";
        public const string CCDic = "Misc/ccdic.txt";
        public const string CODic = "Misc/codic.txt";
        public const string BSTCheck = "Misc/bst-check.txt";
        public const string FreqUni = "Resources/freq-unigram.txt";
        public const string FreqBi = "Resources/freq-bigram.txt";

        // bảng
        public const string TTable1 = "Tables/TTable1.xml";
        public const string TTable2 = "Tables/TTable2.xml";
        public const string TTable3 = "Tables/TTable3.xml";
        public const string SCTable = "Tables/SCTable.xml";
        public const string BSTTable1 = "Tables/BSTTable1.xml";
        public const string BSTTable2 = "Tables/BSTTable2.xml";
        public const string BSTTable3 = "Tables/BSTTable3.xml";
        public const string VWNTable = "Tables/VWNTable.xml";
    }

    public static class Global
    {
        private static WordNetEngine _wnEngine = new WordNetEngine(Paths.WNDatabase, true);

        public static WordNetEngine WNEngine
        {
            get
            {
                if (_wnEngine == null)
                    _wnEngine = new WordNetEngine(Paths.WNDatabase, true);
                return _wnEngine;
            }
        }

        public static void Start()
        {
            _wnEngine = new WordNetEngine(Paths.WNDatabase, true);
        }
    }
}